#include<bits/stdc++.h>
using namespace std;
#define int long long
#define N 100005
#define mod 998244353
#define mp make_pair
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
const int INF=1e9;
int qpow(int a,int b){
	int res=1;
	while(b){
		if(b&1) res=res*a%mod;
		a=a*a%mod;b>>=1;
	}
	return res;
}
/*
int fac[N],ifac[N];
int C(int n,int m){
	if(n<m||n<0||m<0) return 0;
	return fac[n]*ifac[m]%mod*ifac[n-m]%mod;
}
void init(){
	fac[0]=1;
	for(int i=1;i<N;i++) fac[i]=fac[i-1]*i%mod;
	ifac[N-1]=qpow(fac[N-1],mod-2);
	for(int i=N-2;i>=0;i--) ifac[i]=ifac[i+1]*(i+1)%mod;
}*/
int a[N],n;
signed main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	int l=1,r=n,res=0;
	while(l<=r){
		int mid=(l+r)>>1;
		queue<int>q;
		while(!q.empty()) q.pop();
		for(int i=1;i<=n;i++){
			if(!q.empty()){
				int u=q.front();
				if(u<a[i]) q.pop();
			}
			if(i<mid) q.push(a[i]);
		}
		if(q.empty()) res=mid,l=mid+1;
		else r=mid-1;
	}
	cout<<n-res+1<<endl;
	return 0;
}